/**
*      author: Y_Yao
*      created: 2024-09-17 21:09:39
**/

#include<bits/stdc++.h>
using LL = long long;

using namespace std;

void solve()
{
    int a,b;
    cin >> a >> b;
    LL sum = 0;
    sum = a * 1 + b * 2;
    if(sum % 2 == 1)
    {
        cout<<"NO"<<endl;
        return;
    }

    sum = sum / 2;

    if(sum<=a)
    {
        cout<<"YES"<<endl;
        return;
    }

    if(sum % 2 != 1 && sum <= b)
    {
        cout<<"YES"<<endl;
        return;        
    }

    if((sum - a) % 2 != 1 && sum - a <= b)
    {
        cout<<"YES"<<endl;
        return;            
    }

    if(sum - b > 0 && sum - b <= a)
    {
        cout<<"YES"<<endl;
        return; 
    }
    cout<<"NO"<<endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}